package com.yun.zhong.fu.sharecenter;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;


@MapperScan("com.yun.zhong.fu.sharecenter.dao")
@SpringBootApplication
//开启feign远程调用,defaultConfiguration参数实现fegin全局日志级别的设定
@EnableFeignClients//(defaultConfiguration = {UserCenterFeignConfigration.class})
//让cloudstream生效的注解,消息生产者
@EnableBinding(Source.class)
//引用自定义接口实现消息的生产与推送
//@EnableBinding(MySource.class)
public class ShareCenterApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShareCenterApplication.class, args);


    }

    //集成ribbon负载均衡
    @Bean
    @LoadBalanced
    public RestTemplate getRest() {
        return new RestTemplate();
    }


}
